package controllers.listeners.lexicon;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

import views.ViewLexicon;

/* Refreshes the table to show the Stem/Feature/Form views */
/* actionPerformed when you click on the "Stems", "Features" or "Forms" buttons */
public class ViewsButtonActionListener implements ActionListener {
	
	private ViewLexicon view;
	
	public ViewsButtonActionListener() {
		view = null;
	}
	
	@Override
	public void actionPerformed(ActionEvent evt) {
		JButton button = (JButton) evt.getSource();
		view.setButtonSelected(button.getText());
		view.refreshTable();
	}
	
	public void setView(ViewLexicon view) {
		this.view = view;
	}
	
}
